Skip to content

Conversation

RamyHakam
Copy link
Contributor

@RamyHakam RamyHakam commented Sep 12, 2025

Q A
Bug fix? yes
New feature? yes
Docs? no
Issues Fix #326
License MIT

Description

Implements event-based input processing to resolve fatal errors when string payloads are passed to ModelClient implementations using array_merge($payload, $options).

Solution:

  • PlatformInvokationEvent: Dispatched before platform invocation
  • StringToMessageBagListener: Converts strings to MessageBag for models with INPUT_MESSAGES capability
  • Enables simple usage: $platform->invoke($model, 'Hello')

Backward Compatible: EventDispatcher is optional, existing code unchanged.

Add PlatformInvokationEvent and StringToMessageBagListener to convert
string inputs to MessageBag for models with INPUT_MESSAGES capability.
Enables $platform->invoke($model, 'Hello') usage pattern.

Fixes symfony#326
@carsonbot carsonbot added Bug Something isn't working Feature New feature Platform Issues & PRs about the AI Platform component Status: Needs Review labels Sep 12, 2025
@chr-hertel chr-hertel added the Hackathon 2025 This issue or pull request was part of the Symfony AI Hackathon 2025 label Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Feature New feature Hackathon 2025 This issue or pull request was part of the Symfony AI Hackathon 2025 Platform Issues & PRs about the AI Platform component Status: Needs Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Platform] Fatal Error: array_merge() called with string payload in ModelClient implementations
3 participants